import {getGoodsAPI} from '@/api/home'

const state = {
    // 产品列表数据列表
    goodsList:[],
}
const actions = {
    // 获取产品列表的数据
    async getGoodsList({commit}){
        let res = await getGoodsAPI();
        if(res.status === true){
            commit('GETGOODSLIST',res.data);
        }
    }
}
const mutations ={
    GETGOODSLIST(state,goodsList){
        state.goodsList = goodsList;
    }
}
const getters = {}

export default{
    namespaced:true,
    state,
    actions,
    mutations,
    getters,
}